package com.vegas.netspider.apps.parser;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class PageWebParser implements WebParser<Integer>{
	
	private Pattern pattern = Pattern.compile("parent.t_page=(\\d{1,2});");

	@Override
	public Integer parse(String res) {
		if(res==null){
			return 0;
		}
		
		Matcher m = pattern.matcher(res);
		
		if(m.find()){
			return Integer.valueOf(m.group(1));
		}
		
		return 0;
	}

}
